﻿using LxBasic;
using LxCore;

namespace LxCore
{
    public class FvBound : JsIdentifyItem, IIndexHost
    {
        public FvBound(FvZone inZone)
        {
            InZone = inZone;
        }
        public FvBound(FvZone inZone,FvJoint inJoint)
        {
            InZone = inZone;
            InJoint = inJoint;
        }
        #region 几何信息
        public FvZone InZone;
        public FvJoint InJoint;
        #endregion
        public double Area { get; set; }
        public IndexRange CellIdx => BouFaceIdx;
        public IndexRange FaceIdx => BouFaceIdx;
        public IndexRange BouFaceIdx;
        public override void FromJsonKV(string key, IJsonReader jsReader)
        {
            switch (key)
            {
                case nameof(BouFaceIdx): BouFaceIdx = jsReader.ReadIndexRange(); break;
                default: base.FromJsonKV(key, jsReader); break;
            }
        }
        public override void ToJsonKV(IJsonWriter jsWriter)
        {
            base.ToJsonKV(jsWriter);
            jsWriter.WriteIndexRange(nameof(BouFaceIdx), BouFaceIdx);
        }
    }
}
//public string Name { get; set; }
//public int ID { get; set; }